package org.mikeliu.exp5.homework2;

import java.util.Arrays;
import java.util.Scanner;

public class Main 
{
	public static void main(String[] args) 
	{
		Scanner scanner=new Scanner(System.in);
		int[] A=new int[scanner.nextInt()];
		for(int i=0;i<A.length;i++)
		{
			A[i]=scanner.nextInt();
		}
		int[] B=new int[A.length];
		B=A.clone();
		Arrays.sort(B);
		int countOfElementsAGraterThanB=0;
		int countOfElementsAEqualsB=0;
		int countOfElementsALessThanB=0;
		for(int i=0;i<A.length;i++)
		{
			if(A[i]>B[i])countOfElementsAGraterThanB++;
			else if(A[i]<B[i])countOfElementsALessThanB++;
			else countOfElementsAEqualsB++;
		}
		System.out.println(countOfElementsAGraterThanB);
		System.out.println(countOfElementsAEqualsB);
		System.out.println(countOfElementsALessThanB);
	}
}
